package com.corelib.config;

import android.content.Context;
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageManager;

/**
 * Created by wangxm on 2018/1/26.
 */

public class AppUtils {
    public static String getMetaData(Context c, String name){
        ApplicationInfo appInfo = null;
        try {
            appInfo = c.getPackageManager()
                    .getApplicationInfo(c.getPackageName(), PackageManager.GET_META_DATA);
        } catch (Exception e) {
            e.printStackTrace();
            return "";
        }
        String result = appInfo.metaData.getString(name);
        return result == null ? "":result;
    }
}
